package com.boss.service.impl;

import com.boss.entity.User;
import com.boss.mapper.UserMapper;
import com.boss.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    /**
     * 获取信息
     * @param user
     * @return
     */
    @Override
    public List<User> getUser(User user) {
        return userMapper.getUser(user);
    }

    /**
     * 添加数据
     * @param user
     * @return
     */
    @Override
    public Integer addUser(User user) {
        return userMapper.addUser(user);
    }
    /**
     * 修改密码
     * @param user
     * @return
     */
    @Override
    public Boolean updateUserByPwd(User user) {
        if(userMapper.updateUserByPwd(user)==1){
            return true;
        }else {
            return false;
        }
    }

}
